You can add a comment to your JavaScript code starting the comment with two slashes "//":

sum=a + b  //calculating the sum

You can also add a comment to the JavaScript code, starting the comment with "/*" and ending it with "*/"

sum=a + b  /*calculating the sum*/

#Title: JavaScript Guidelines
#Element: 297: Comments You can add a comment to your JavaScript ...
#Article: 173: JavaScript Guidelines